/**
 * Created by subo on 16/4/20.
 */
var navBarIndex = {'home':0, 'category':1, 'shop':2, 'cart':3, 'mine':4};
$(document).on("pagebeforecreate",function(event){
	homePage();
});
function homePage() {
	navToPage(navBarIndex.shop)
}
function navToPage(i) {
	var page_content = $("div[data-role='content']");
	var page_footer = $("div[data-role='footer']");
	switch (i) {
		case navBarIndex.home:
			document.title = '首页';
			var header = 'product_home/product_home_banner.html';
			var title_bar_div;
			title_bar_div = $("div[data-role='header']");
			title_bar_div.attr('data-position', 'fixed');
			title_bar_div.attr('data-tap-toggle', 'false');
			title_bar_div.load(header, function () {
				load_banners();
			});
			page_content.attr('id', 'product_home');
			page_content.load('product_home/product_home.htm_');
			break;
		case navBarIndex.category:
			document.title = '商铺分类';
			loadTitleBar2(category_titles,category_con_1,category_con_2);
			page_content.load('category/category.html',function(){
				categoryHomeIndex();
			});
			break;
		case navBarIndex.shop:
			document.title = '商铺首页';
			loadTitleBar2_L1(shop_home_titles, shophome_tab_shoplist, shophome_tab_recommend);
			page_content.load('shop_home/shop_home.html', function(){
				initShopHomePage();
			});
			break;
		case navBarIndex.cart:
			break;
		case navBarIndex.mine:
			break;
		default:
			break;
	}
}
